#include<iostream>

struct CandyBar
{
	char kind[20];
	double weight;
	int calorie;
};

void Display(CandyBar* s)
{
	for (int i = 0; i < 3; i++)
		std::cout << "Kind: " << s[i].kind << "\nweight: " << s[i].weight << "\ncalrio:" << s[i].calorie;
}

int main()
{
	CandyBar* snack = new CandyBar[3];
	for (int i = 0; i < 3; i++)
	{
		std::cout << "Enter the kind of sugar: ";
		std::cin.getline(snack[i].kind, 20);
		std::cout << "Enter the  weight of sugar: ";
		std::cin >> snack[i].weight;
		std::cout << "Enter the  calorie of sugar: ";
		std::cin >> snack[i].calorie;
		std::cin.get();
	}
	Display(snack);
	delete[]snack;
	return 0;
}